<section class="content-header">
    <h1>
        内容管理
        <small></small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <!-- /.col -->
        <div class="col-md-12">
            <div class="box">
                <div class="box-header with-border">
                    <h3 class="box-title">页面管理</h3>
                    <!-- /.box-tools -->
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                    <div class="mailbox-controls">
                        <div class="btn-group">
                            <a href="/admin/page/add" class="btn btn-danger ">
                                新增页面
                            </a>
                        </div>
                        <!-- /.btn-group -->
                    </div>
                    <div class="table-responsive" style="overflow-x: visible;">
                        <table class="table table-bordered table-hover">
                            <tbody>
                            <tr>
                                <th class="hidden-xs">
                                    <label><input onchange="checkAll()" type="checkbox" value=""></label>
                                </th>
                                <th>ID</th>
                                <th>名称</th>
                                <th>链接</th>
                                <th>状态</th>
                                <th>排序</th>
                                <th>备注</th>
                                <th>时间</th>
                                <th>操作</th>
                            </tr>

                            {{#each page}}
                            <tr>
                                <td class="hidden-xs">
                                    <label><input name="checkbox" class="check" type="checkbox"
                                                  value="{{id}}"></label>
                                </td>
                                <td>
                                    {{id}}
                                </td>
                                <td>
                                    {{name}}
                                </td>
                                <td>
                                    <div class="btn-group" style="margin: 0px">
                                        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                            链接<span class="caret"></span></button>
                                        <div class="dropdown-menu" style="padding: 10px;max-width: none;">
                                            /cms/page/{{pinyin}}
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    {{#eq status 1}}
                                    <span class="label label-success">开启</span>
                                    {{else}}
                                    <span class="label label-default">关闭</span>
                                    {{/eq}}
                                </td>
                                <td>
                                    {{rank}}
                                </td>
                                <td>
                                    {{remark}}
                                </td>
                                <td>
                                    {{moment created_at 'YYYY-MM-DD HH:mm:ss'}}
                                </td>
                                <td class="table-action">
                                    <a href="/admin/page/add?id={{id}}">编辑</a>
                                    {{#eq status 1}}<a href="/admin/page/update?id={{id}}&status=0">关闭</a>{{/eq}}
                                    {{#eq status 0}}<a href="/admin/page/update?id={{id}}&status=1">开启</a>{{/eq}}
                                </td>
                            </tr>
                            {{/each}}

                            </tbody>
                        </table>
                        <div class="box-footer no-padding">
                            <div class="mailbox-controls">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-danger "
                                            onclick="batchUrl('/admin/page/update?status=1')">开启
                                    </button>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-danger "
                                            onclick="batchUrl('/admin/page/update?status=0')">
                                        关闭
                                    </button>
                                </div>
                                <div class="pull-right">
                                    {{{pagination}}}
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.mail-box-messages -->
                </div>
            </div>
            <!-- /. box -->
        </div>
        <!-- /.col -->
    </div>
</section>